package com.neu.credit.creditscore.entity.books;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@TableName("book_sub_borrowings")
@Schema(name = "BookSubBorrowings", description = "图书借阅子记录表")
public class BookSubBorrowings {

    //预下单
    public final static int STATUS_PRE = 0;
    //借阅中
    public final static int STATUS_USING = 1;
    //已归还
    public final static int STATUS_USED = 2;
    //以逾期
    public final static int STATUS_OVERDUE = 3;

    @Schema(description = "子借阅ID，自增主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "图书ID")
    private Integer bookId;

    @Schema(description = "借阅ID")
    private Integer borrowingId;

    @Schema(description = "借阅状态0-预下单， 1-借阅中， 2-已归还")
    private int borrowingStatus;

    @Schema(description = "创建时间")
    private LocalDateTime createdAt;

    @Schema(description = "更新时间")
    private LocalDateTime updatedAt;
    @TableField(exist = false)
    @Schema(description = "图书详细信息")
    private  Books bookInfo;
}